package io.github.betwowt.minio.util;

/**
 *
 * @author betwowt
 * @date 2019/04/02
 */
public class FileUtil {

    /**
     * 通过文件名的拿到其后缀名
     * aaa.txt -> .txt
     * aaa -> ''
     * @param fileName
     * @return
     */
    public static String getFileSuffixName(String fileName){
        int i = fileName.lastIndexOf(".");
        String suffixName = null;
        if (i>0){
            suffixName  = fileName.substring(i);
        }else {
            suffixName = "";
        }
        return suffixName;
    }
}
